package cn.concurrence.blockqueue;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;

/**
 * @author summit
 * @since 2022/4/24 17:44
 */
public class BlockQueueTest {
	private static BlockingQueue<Integer> blockingQueue = new ArrayBlockingQueue<>(1);

	public static void main(String[] args) throws InterruptedException {
		insert();
	}

	private static void insert() throws InterruptedException {
//		blockingQueue.add(1);
//		blockingQueue.add(2);

//		System.out.println(blockingQueue.offer(1));
//		System.out.println(blockingQueue.offer(2));

//		blockingQueue.put(1);
//		blockingQueue.put(2);

		blockingQueue.offer(1, 2,TimeUnit.SECONDS);
		blockingQueue.offer(2, 2,TimeUnit.SECONDS);


	}
}
